<?php

	include 'db.php';

	$update_material_prices->bind_param( 'id', $mat_id, $new_price );

	foreach( $_POST as $mat_id => $new_price )
	{
		$update_material_prices->execute();
	}

	$update_material_prices->close();

	date_default_timezone_set('UTC');
	$update_date = date('Y-m-d H:i:s');
	$table_name = "prices_materials";
	$update_table_mod_timestamp->bind_param( 'ss', $table_name, $update_date);
	$update_table_mod_timestamp->execute();
	$update_table_mod_timestamp->close();

	include 'show_and_edit_material_prices.php';

?>